<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章列表</title>
    <!-- 加载css文件 -->
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/assets/css/article.css/list.css">
    <!-- 加载js文件 -->
    <script src="/assets/lib/jquery.js"></script>
    <script src="/assets/lib/layui/layui.all.js"></script>
    <!-- 加载公共的js样式  -->
    <script src="/assets/js/common.js"></script>
    <!-- 引入模板引擎js文件 -->
    <script src="/assets/lib/template-web.js"></script>
    <script src="/assets/js/article.js/list.js"></script>
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">文章列表</div>
        <div class="layui-card-body">
            <!-- 第一行 搜索区 -->
            <form class="layui-form" action="" id="search-form">
                <div class="layui-form-item">

                    <div class="layui-inline">
                        <div class="layui-input-inline" style="width: 200px;">
                            <select id="category" name="cate_id" lay-verify="">

                            </select>
                        </div>
                        <div class="layui-input-inline" style="width: 200px;">
                            <select name="state" lay-verify="">
                                <option value="">请选择状态</option>
                                <option value="已发布">已发布</option>
                                <option value="草稿">草稿</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-inline">
                        <div class="layui-input-inline" style="width: 100px;">
                            <button class="layui-btn" lay-submit lay-filter="formDemo">筛选</button>
                        </div>
                    </div>
                </div>
            </form>
            <!-- 第二行 表格区 -->
            <table class="layui-table">
                <colgroup>
                    <col width="45%">
                    <col width="15%">
                    <col width="15%">
                    <col width="15%">
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>文章标题</th>
                        <th>分类</th>
                        <th>发表时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
            <!-- 第三行 分页区 -->
            <div id="page">

            </div>
        </div>
    </div>


    <!-- 文章列表的模板 -->
    <script type="text/html" id="tpl-article">
        {{each data}}
        <tr>
            <td>{{$value.title}}</td>
            <td>{{$value.cate_name}}</td>
            <td>{{$value.pub_date}}</td>
            <td>{{$value.state}}</td>
            <td>
                <a href="/article(文章模块)/edit.html?id={{$value.Id}}" class="layui-btn layui-btn-xs">编辑</a>
                <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" data-id="{{$value.Id}}">删除</button>
            </td>
        </tr>
        {{/each}}
    </script>
    <!-- 下拉框分类的模板 start -->
    <script type="text/html" id="tpl-category">
        <option value="">请选择分类</option>
        {{each data val}}
        <option value="{{val.Id}}">{{val.name}}</option>
        {{/each}}
      </script>
    <!-- 下拉框分类的模板 end -->
</body>

</html>